# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Frop Doe <mrmr@rizla.org>
# Contributor: Guillermo A. Amaral <me@guillermoamaral.com> (thewonka)
# Mainteiner: Guillermo A. Amaral <me@guillermoamaral.com> (thewonka)

pkgname=chrootuid
pkgver=1.3
pkgrel=10
arch=(loong64 x86_64)
pkgdesc="Runs a command in a restricted environment."
url="http://ftp.porcupine.org/pub/security/index.html"
license=("BSD")
depends=(glibc)
source=(http://ftp.porcupine.org/pub/security/$pkgname$pkgver.tar.gz
	http://ftp.porcupine.org/pub/security/chrootuid_license)
md5sums=('15510abadf5de189e1c22a1544dc926a'
         '11383ad1d66445640f1dec3478a2b53f')
sha256sums=('93dd1af0220bce0c0265c9f810a89f7fae56b34b7077397f8ea2dcb54ec169b3'
            '45432b6a45d993c0d05fedd7aba81ece972d4e2e82e23621cda5d234644af83d')

build() {
  cd "$srcdir"/$pkgname$pkgver
  make
}

package() {
  cd "$srcdir"/$pkgname$pkgver
  install -D -m755 "$srcdir"/$pkgname$pkgver/chrootuid "$pkgdir"/usr/bin/chrootuid
  install -D -m644 "$srcdir"/$pkgname$pkgver/chrootuid.1 "$pkgdir"/usr/share/man/man1/chrootuid.1
  install -D -m644 "$srcdir"/chrootuid_license "$pkgdir"/usr/share/licenses/$pkgname/license
}
